#! /usr/bin/python

max, max_a, max_b = 0, 0, 0
 
for a in xrange(90, 100):
     for b in xrange(90, 100):
         sum_digits = sum(int(digit) for digit in str(a**b))
         if sum_digits > max: max, max_a, max_b = sum_digits, a, b
print "Answer to PE56 = ",max,"a=",max_a,"b=",max_b
